namespace Digitalmes.Domain.Sys;

/// <summary>
/// 管理员表
/// </summary>
[SugarTable("sys_admin", "管理员表")]
public class SysAdmin : EntityTenantBase, IDeletedFilter
{
    /// <summary>
    /// 所属岗位集合，若没有岗位则返回空集合。
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "所属岗位集合", IsJson = true, Length = 255)]
    public List<string>? PostGroup { get; set; }

    /// <summary>
    /// 所属部门
    /// </summary>
    [SugarColumn(ColumnDescription = "所属部门")]
    public long OrganizeId { get; set; }

    /// <summary>
    /// 所属部门
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(OrganizeId))]
    public SysOrganize? OrganizeObj { get; set; }

    /// <summary>
    /// 登录账号
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "登录账号", Length = 64)]
    public string? LoginAccount { get; set; }

    /// <summary>
    /// 登录密码
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "登录密码", Length = 64)]
    public string? LoginPassWord { get; set; }

    /// <summary>
    /// 头像
    /// </summary>
    [SugarColumn(ColumnDescription = "头像", Length = 128)]
    public string? Avatar { get; set; }

    /// <summary>
    /// 姓名
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "姓名", Length = 32)]
    public string? FullName { get; set; }

    /// <summary>
    /// 手机号码
    /// </summary>
    [SugarColumn(ColumnDescription = "手机号码", Length = 32)]
    public string? Mobile { get; set; }

    /// <summary>
    /// 邮箱
    /// </summary>
    [SugarColumn(ColumnDescription = "邮箱", Length = 32)]
    public string? Email { get; set; }

    /// <summary>
    /// 性别
    /// </summary>
    [SugarColumn(ColumnDescription = "性别", Length = 16)]
    public string? Sex { get; set; }

    /// <summary>
    /// 状态
    /// </summary>
    [SugarColumn(ColumnDescription = "状态")]
    public bool Status { get; set; } = true;

    /// <summary>
    /// 软删除
    /// </summary>
    [SugarColumn(ColumnDescription = "软删除")]
    public bool IsDel { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", Length = 255)]
    public string? Summary { get; set; }

    /// <summary>
    /// 登录时间
    /// </summary>
    [SugarColumn(ColumnDescription = "登录时间")]
    public DateTime? LoginTime { get; set; }

    /// <summary>
    /// 上次登录时间
    /// </summary>
    [SugarColumn(ColumnDescription = "上次登录时间")]
    public DateTime? UpLoginTime { get; set; }

    /// <summary>
    /// 登录次数
    /// </summary>
    [SugarColumn(ColumnDescription = "登录次数")]
    public int LoginCount { get; set; }
}
